<!-- src/views/admin/settings/components/SecuritySettings.vue -->
<template>
  <div>
    <h2>安全设置</h2>
    <el-form :model="form" ref="formRef" label-width="100px">
      <el-form-item label="当前密码" prop="currentPassword">
        <el-input type="password" v-model="form.currentPassword" style="max-width: 300px;" />
      </el-form-item>
      <el-form-item label="新密码" prop="newPassword">
        <el-input type="password" v-model="form.newPassword" style="max-width: 300px;" />
      </el-form-item>
      <el-form-item label="确认密码" prop="confirmPassword">
        <el-input type="password" v-model="form.confirmPassword" style="max-width: 300px;" />
      </el-form-item>
      <el-button type="primary" @click="changePassword">修改密码</el-button>
    </el-form>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue';

const form = ref({
  currentPassword: '',
  newPassword: '',
  confirmPassword: '',
});

const changePassword = () => {
  if (form.value.newPassword !== form.value.confirmPassword) {
    console.error('新密码和确认密码不匹配');
    return;
  }
  // 修改密码逻辑
  console.log('修改密码:', form.value);
};
</script>

<style scoped>
/* 样式可根据需要调整 */
</style>
